home *** CD-ROM | disk | FTP | other *** search
/ George of the Jungle Press Kit / GEORGE.iso / pc / george.dxr / Internal_889_std handlers.ls < prev    next >
Encoding:
Text File  |  1997-06-23  |  7.9 KB  |  326 lines

  1. global gBtnList, gCastLoopDone, gTrailerLoopDone, gCurrentFrame, gFlashState, gAnimalLoopDone, gProLoopDone
  2.  
  3. on startMovie
  4.   set gCastLoopDone to 0
  5.   set gAnimalLoopDone to 0
  6.   set gProLoopDone to 0
  7.   set gTrailerLoopDone to 0
  8.   set gFlashState to 1
  9.   register(xtra("PrintOMatic"), "POMX153-067-03058")
  10. end
  11.  
  12. on stopMovie
  13. end
  14.  
  15. on init start, stop, TF, whichcursor
  16.   repeat with whichSprite = start to stop
  17.     puppetSprite(whichSprite, TF)
  18.     set the cursor of sprite whichSprite to whichcursor
  19.   end repeat
  20. end
  21.  
  22. on wait ticks
  23.   set startDelay to the timer
  24.   repeat while the timer < (startDelay + ticks)
  25.   end repeat
  26. end
  27.  
  28. on initBtns
  29.   set start to 1
  30.   set stop to 48
  31.   set gBtnList to []
  32.   repeat with s = start to stop
  33.     if the memberNum of sprite s <> 0 then
  34.       if word 1 of the name of member the memberNum of sprite s = "btn" then
  35.         add(gBtnList, new(script "btnParentScript", s))
  36.         puppetSprite(s, 1)
  37.         set the cursor of sprite s to [the number of member "pushCursor", the number of member "pushMask"]
  38.         next repeat
  39.       end if
  40.       if word 1 of the name of member the memberNum of sprite s = "radio" then
  41.         add(gBtnList, new(script "RadioBtnParentScript", s))
  42.         puppetSprite(s, 1)
  43.         set the cursor of sprite s to [the number of member "pushCursor", the number of member "pushMask"]
  44.         next repeat
  45.       end if
  46.       if word 1 of the name of member the memberNum of sprite s = "scroll" then
  47.         add(gBtnList, new(script "ScrollBtnParentScript", s))
  48.         puppetSprite(s, 1)
  49.         set the cursor of sprite s to [the number of member "pushCursor", the number of member "pushMask"]
  50.         next repeat
  51.       end if
  52.       if word 1 of the name of member the memberNum of sprite s = "chk" then
  53.         add(gBtnList, new(script "ChkBtnParentScript", s))
  54.         puppetSprite(s, 1)
  55.         set the cursor of sprite s to [the number of member "pushCursor", the number of member "pushMask"]
  56.       end if
  57.     end if
  58.   end repeat
  59. end
  60.  
  61. on doRoll
  62.   repeat with whichbtn in gBtnList
  63.     if (the memberNum of sprite the myS of whichbtn = the myUpState of whichbtn) or (the memberNum of sprite the myS of whichbtn = the myRollState of whichbtn) then
  64.       doRoll(whichbtn)
  65.     end if
  66.   end repeat
  67. end
  68.  
  69. on doRollAnim
  70.   repeat with whichbtn in gBtnList
  71.     if (the memberNum of sprite the myS of whichbtn = the myUpState of whichbtn) or (the memberNum of sprite the myS of whichbtn = the myRollState of whichbtn) then
  72.       doRollAnim(whichbtn)
  73.     end if
  74.   end repeat
  75. end
  76.  
  77. on getBtnObj s
  78.   repeat with whichbtn in gBtnList
  79.     if s = the myS of whichbtn then
  80.       return whichbtn
  81.     end if
  82.   end repeat
  83.   alert("Problem locating this button object. Check 'initbtns' handler. Is sprite " & s & " in the list?")
  84. end
  85.  
  86. on goPlay
  87.   set the movieRate of sprite 6 to 1
  88.   set the loc of sprite 10 to the loc of sprite 9
  89.   set the loc of sprite 9 to point(-500, -500)
  90.   updateStage()
  91. end
  92.  
  93. on goPause
  94.   set the movieRate of sprite 6 to 0
  95.   set the loc of sprite 9 to the loc of sprite 10
  96.   set the loc of sprite 10 to point(-500, -500)
  97.   updateStage()
  98. end
  99.  
  100. on goRewind
  101.   if the movieTime of sprite 6 <> 0 then
  102.     set the movieTime of sprite 6 to 0
  103.     set the movieRate of sprite 6 to 0
  104.     set the loc of sprite 9 to point(320, 240)
  105.     set the loc of sprite 10 to point(-500, -500)
  106.     updateStage()
  107.   end if
  108. end
  109.  
  110. on activeLoop startMember, stopMember, s
  111.   global gLoopCount
  112.   if not (the puppet of sprite s) then
  113.     puppetSprite(s, 1)
  114.   end if
  115.   if the name of member the memberNum of sprite s <> stopMember then
  116.     set the memberNum of sprite s to the number of member startMember + gLoopCount
  117.     set gLoopCount to gLoopCount + 1
  118.     updateStage()
  119.     return 0
  120.   else
  121.     return 1
  122.   end if
  123. end
  124.  
  125. on castLoop n, snd, ticks, start, end
  126.   if not integerp(start) then
  127.     set start to the number of member start
  128.   end if
  129.   if not integerp(end) then
  130.     set end to the number of member end
  131.   end if
  132.   preLoadCast(start, end)
  133.   set puppetState to the puppet of sprite n
  134.   puppetSprite(n, 1)
  135.   if snd <> 0 then
  136.     puppetSound(snd)
  137.   end if
  138.   repeat with i = start to end
  139.     set the castNum of sprite n to i
  140.     updateStage()
  141.     if ticks > 0 then
  142.       wait(ticks)
  143.     end if
  144.   end repeat
  145.   unLoadCast(start, end - 1)
  146.   puppetSprite(n, puppetState)
  147. end
  148.  
  149. on backLoop n, snd, ticks, start, end
  150.   if not integerp(start) then
  151.     set start to the number of member start
  152.   end if
  153.   if not integerp(end) then
  154.     set end to the number of member end
  155.   end if
  156.   preLoadCast(start, end)
  157.   set puppetState to the puppet of sprite n
  158.   puppetSprite(n, 1)
  159.   if snd <> 0 then
  160.     puppetSound(snd)
  161.   end if
  162.   repeat with i = start down to end
  163.     set the castNum of sprite n to i
  164.     updateStage()
  165.     if ticks > 0 then
  166.       wait(ticks)
  167.     end if
  168.   end repeat
  169.   unLoadCast(start, end)
  170.   puppetSprite(n, puppetState)
  171. end
  172.  
  173. on apeLoop n, snd, ticks, start, end
  174.   preloadMember("apeThud", "wiff")
  175.   if not integerp(start) then
  176.     set start to the number of member start
  177.   end if
  178.   if not integerp(end) then
  179.     set end to the number of member end
  180.   end if
  181.   preLoadCast(start, end)
  182.   puppetSound(snd)
  183.   updateStage()
  184.   set puppetState to the puppet of sprite n
  185.   set flag to 0
  186.   puppetSprite(n, 1)
  187.   set counter to 1
  188.   repeat with i = start to end
  189.     set the castNum of sprite n to i
  190.     if (counter = 10) or (counter = 20) then
  191.       puppetSound("apeThud")
  192.     else
  193.       if (counter > 25) and (counter < 36) and not flag then
  194.         puppetSound("wiff")
  195.         set flag to 1
  196.       else
  197.         if counter = 36 then
  198.           puppetSound("woodKnock")
  199.         end if
  200.       end if
  201.     end if
  202.     updateStage()
  203.     set counter to counter + 1
  204.     if ticks > 0 then
  205.       wait(ticks)
  206.     end if
  207.   end repeat
  208.   unLoadCast(start, end - 1)
  209.   puppetSprite(n, puppetState)
  210. end
  211.  
  212. on goMovie movieNum
  213.   init(1, 48, 0, 0)
  214.   go(gCurrentFrame & movieNum)
  215. end
  216.  
  217. on goClip clipNum
  218.   init(1, 48, 0, 0)
  219.   if clipNum = "making of" then
  220.     if the memberNum of sprite 6 > 0 then
  221.       if the type of member the memberNum of sprite 6 = #digitalVideo then
  222.         if not (the puppet of sprite 6) then
  223.           puppetSprite(6, 1)
  224.         end if
  225.         set the memberNum of sprite 6 to the number of member "matte left"
  226.         set the loc of sprite 6 to point(320, 240)
  227.         updateStage()
  228.       end if
  229.     end if
  230.     init(1, 48, 0, 0)
  231.     go("making of")
  232.   else
  233.     go(gCurrentFrame & clipNum)
  234.   end if
  235. end
  236.  
  237. on goPic picNum
  238.   init(1, 48, 0, 0)
  239.   if not (the puppet of sprite 32) then
  240.     puppetSprite(32, 1)
  241.   end if
  242.   set the memberNum of sprite 32 to the number of member ("Print" & picNum)
  243.   updateStage()
  244.   go(the frame + 1)
  245. end
  246.  
  247. on flasher
  248.   repeat with s = 16 to 21
  249.     if the name of member the memberNum of sprite s = "roll" then
  250.       set g to 1
  251.       exit repeat
  252.       next repeat
  253.     end if
  254.     set g to 0
  255.   end repeat
  256.   if g = 0 then
  257.     if not (the puppet of sprite 23) then
  258.       puppetSprite(23, 1)
  259.     end if
  260.     set the memberNum of sprite 23 to the number of member ("flash" & random(5))
  261.     updateStage()
  262.     wait(20)
  263.     set the memberNum of sprite 23 to the number of member "dot"
  264.   end if
  265. end
  266.  
  267. on goPrint
  268.   set doc to new(xtra("PrintOMatic"))
  269.   if not objectp(doc) then
  270.     exit
  271.   end if
  272.   setLandscapeMode(doc, 1)
  273.   newPage(doc)
  274.   append(doc, sprite(32))
  275.   if doJobSetup(doc) = 1 then
  276.     print(doc)
  277.   end if
  278.   set doc to 0
  279. end
  280.  
  281. on goPrintText
  282.   set doc to new(xtra("PrintOMatic"))
  283.   if not objectp(doc) then
  284.     exit
  285.   end if
  286.   newPage(doc)
  287.   append(doc, sprite(7))
  288.   if doJobSetup(doc) = 1 then
  289.     print(doc)
  290.   end if
  291.   set doc to 0
  292. end
  293.  
  294. on goPreAnimals
  295.   init(1, 48, 0, 0)
  296.   go("preanimals")
  297. end
  298.  
  299. on goAnimalsFrame
  300.   global gAnimalLoopDone
  301.   init(1, 48, 0, 0)
  302.   if gAnimalLoopDone then
  303.     go("AnimalAnimDone")
  304.   else
  305.     go("Animals")
  306.   end if
  307. end
  308.  
  309. on scriptBot
  310.   set temp to the scriptText of member 572
  311.   set s to 572
  312.   repeat while s <= 633
  313.     set s to s + 3
  314.     set the scriptText of member s to temp
  315.   end repeat
  316. end
  317.  
  318. on nameBot
  319.   set temp to the name of member 871
  320.   set s to 871
  321.   repeat while s <= 965
  322.     set s to s + 3
  323.     set the name of member s to temp
  324.   end repeat
  325. end
  326.